$(function() {
    var box = document.querySelector("#box");

    function getId() {
        return location.hash.split("=")[1];
    }
    console.log(getId())

    function init() {

        let res = $.ajax({
                url: "http://127.0.0.1:8888/goods/item/" + getId(),
                type: "get"
            })
            .done(function(res) {
                // console.log(res);
                renderPage(res);
            })
    }

    var logo = document.getElementById("logo");
    var detail = document.querySelector(".detail");
    var title = document.getElementById("title");

    function renderPage(res) {

        console.log(res.info);


        logo.src = res.info.img_big_logo;
        detail.innerHTML = res.info.goods_introduce;
        title.innerHTML = res.info.title;

    }

    init();
})